home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / logbatch / retain.exe / RETAIN.DOC next >
Text File  |  1993-03-20  |  3KB  |  70 lines

  1.                               RETAIN ver 1.0
  2.                        (c)Copyright 1993, Chris Lowe
  3.  
  4.  
  5. The problem...
  6.  
  7. I was in the process of installing a 100+ user version of Netware 386 when a
  8. slight problem cropped up. As you know, you can MAP a fake root drive to the
  9. users home directory (a very useful function). The command is usually in the
  10. system login script and the syntax is probably something like this..
  11.  
  12. MAP ROOT DRIVE:=SERVER_NAME/VOLUME_NAME:USERS/%LOGIN_NAME
  13.  
  14. While this is a really trick idea, it presented me with a dilemma. Our system
  15. is connected to a VAX used for terminal emulation. The login names on the VAX
  16. are constructed using first initial, last name. My login would be CLOWE. The
  17. first initial, last name ID convention is a good idea as it eliminates most
  18. duplicate login names on Novell. HOWEVER... . What happens when the Novell
  19. users login ID is more than 8 characters long, for example RCHRISTENSEN.
  20. Novell creates the users home directory as RCHRISTEN and the MAP ROOT command
  21. SERVER_NAME/VOLUME_NAME:USERS/RCHRISTENSEN fails because it can't find a
  22. directory name longer than 8 characters (unless you hard code the name as
  23. RCHISTEN.SEN and manually create the directory that way). 
  24.  
  25. The solution...
  26.  
  27. What RETAIN does is shorten any DOS environment variable to the left or
  28. right, a specified number of characters. I use it in the following way. In
  29. the system login script are the following commands.
  30.  
  31. DOS SET NETNAME=%LOGIN_NAME
  32. #RETAIN NETNAME L 8
  33.  
  34. In this example the first command puts a variable called NETNAME into the
  35. environment table of the PC and sets it to a value of RCHRISTENSEN. The next
  36. command changes the NETNAME variable to the left 8 characters, RCHRISTEN.
  37.  
  38. The last thing at the end of the system script (I don't use user scripts) is
  39. the command EXIT "NEXTSTEP". In addition to numerous other things, the
  40. nextstep batch file has this command, "MAP ROOT H:CH_1/VOL1:USERS/%NETNAME%".
  41. This works just fine to properly set the users home directory.
  42.  
  43. RETAIN can be used to shorten variables to the left OR right OR a combination
  44. of the two to get something out of the middle of a variable. The syntax for
  45. using RETAIN is
  46.  
  47. RETAIN [VAR_NAME] [L or R] [# of characters]
  48.                                DISCLAIMER
  49.                           (or "covering my butt")
  50.  
  51. I make absolutely NO claims about RETAIN. Use it at your own risk. I am not
  52. responsible for anything it may or may not do.
  53.  
  54.  
  55. You may not charge for the use of RETAIN in any way. RETAIN is not public
  56. domain and I retain all rights. You may use RETAIN free of charge and
  57. distribute it freely provided the program and documentation accompany each
  58. other.
  59.  
  60. Although there is no charge for RETAIN, if you find the program useful, a
  61. contribution of $5.00 would be greatly appreciated. Comments and suggestions
  62. are always welcome.
  63.  
  64. Chris Lowe
  65. P.O. Box 411
  66. Boise, ID 83711
  67.  
  68. Voice: (208) 336-7337
  69. Compuserve: 73627,1745
  70.